<template>
    <div class="uploadImages-container">
        <h-images-upload :imgList="fileList"  @handle-upload="handleUpload" />
        <el-button @click="getaa">aa</el-button>
    </div>
</template>

<script>
import setting from './setting'
    export default {
        name: "uploadImages",
        data() {
            return {
                setting: setting,
                //
                fileList:[
                    {fileId:1, filePath:'https://picsum.photos/400'},
                    {fileId:2, filePath:'https://picsum.photos/500'}
                ]
            }
        },
        created() {
            let _ = this
        },
        methods: {
           async handleUpload(file){
                let _ = this,
                    formData = new FormData()
                formData.append('file', file.file)
                const {data: res} = await _.$H.post(_.$A.upload, formData)
                _.fileList.push({
                    fileId: res.data.fileId,
                    filePath: res.data.fileInternetAddress
                })
            },
            getaa(){
               let _ = this
                console.log(_.fileList)
            }
        },
    }
</script>

<style lang="less" scoped>
@import "index.less";
</style>
